<!DOCTYPE html>
<html>

<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0" />
    <title>乐淘分类</title>
    <link rel="stylesheet" href="assets/mui/css/mui.css" />
    <link rel="stylesheet" href="assets/fa/css/font-awesome.min.css" />
    <link rel="stylesheet" href="css/common.css" />
    <link rel="stylesheet" href="css/category.css" />
</head>

<body>
    <div class="lt_container">
        <header class="lt_topBar">
            <a class="btn_left" href="javascript:history.back();">
                <span class="mui-icon mui-icon-arrowleft"></span>
            </a>
            <h3>乐淘分类</h3>
            <a class="btn_right" href="search.html">
                <span class="fa fa-search"></span>
            </a>
        </header>
        <div class="lt_content">
            <div class="lt_wrapper">
                <!--左侧栏-->
                <div class="lt_cateLeft">
                    <ul>
                        <!--动态渲染-->

                    </ul>
                </div>
                <!--右内容-->
                <div class="lt_cateRight">
                    <ul class="mui-clearfix">
                        <!--动态渲染-->

                    </ul>
                </div>
            </div>
        </div>
        <footer class="lt_tabBar">
            <ul>
                <li>
                    <a href="index.html">
                        <span class="fa fa-home"></span>
                        <p>首页</p>
                    </a>
                </li>
                <li class="now">
                    <a href="category.html">
                        <span class="fa fa-bars"></span>
                        <p>分类</p>
                    </a>
                </li>
                <li>
                    <a href="user/cart.html">
                        <span class="fa fa-shopping-cart"></span>
                        <p>购物车</p>
                    </a>
                </li>
                <li>
                    <a href="user/myindex.html">
                        <span class="fa fa-user"></span>
                        <p>会员中心</p>
                    </a>
                </li>
            </ul>
        </footer>
    </div>
    <!--定义一级分类模板-->
    <script type="text/template" id="firstCategory">
    <% for (var i = 0; i < rows.length; i++) { %>
        <li data-id="<%= rows[i].id %>" class="<%= i===0 ? 'now' : '' %>"><a href="javascript:;"><%= rows[i].categoryName %> </a></li>
    <% } %>
</script>
    <!--定义二级分类模板-->
    <script type="text/template" id="secondCategory">
	<% if (rows.length == 0) { %>
		<li style="width: 100%;margin: 10px 0 0 15px;">当前数据为空，请添加后再试！</li>
	<% } else { %>
		<% for (var i = 0; i < rows.length; i++) { %>
	        <li>
	            <a href="#" data-id="<%= rows[i].id %>">
	                <img src="<%= rows[i].brandLogo %>" onerror="this.src='images/none.jpg'" alt="<%= rows[i].brandName %>">
	                <p><%= rows[i].brandName %></p>
	            </a>
	        </li>
	    <% } %>
	<% } %>
    
</script>
    <script src="assets/mui/js/mui.js"></script>
    <script src="assets/zepto/zepto.min.js"></script>
    <script src="assets/artTemplate/template-native.js"></script>
    <script src="js/common.js"></script>
    <script src="js/category.js"></script>
</body>

</html>